﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Lib_general;

namespace Lib_frmParent
{
    public partial class frmTimkiem : Form
    {
        private Phieunhap phieunhap = new Phieunhap();
        public string _smasp = "";
        public frmTimkiem()
        {
            InitializeComponent();
        }

        private void frmTimkiem_Load(object sender, EventArgs e)
        {
            dvghanghoa.DataSource = phieunhap.Load_form().Tables[0];
        }

        private void dvghanghoa_Enter(object sender, EventArgs e)
        {

        }

        private void dvghanghoa_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                _smasp = dvghanghoa.CurrentRow.Cells[0].Value.ToString();
                this.Close();
            }
        }

        private void frmTimkiem_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                this.Close();
                _smasp = "";
            }
        }
    }
}
